<template>
    <div>
        <h2>排房详情</h2>
        <table class="table  table-bordered">
            <tbody>
                <tr>
                    <td>房型名称</td>
                    <td>
                        <input type="text" v-model="model.Name">
                    </td>
                </tr>


                <tr>
                    <td>房号名称</td>
                    <td>
                        <input type="text" v-model="model.Number">
                    </td>
                </tr>


            </tbody>


        </table>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import axios from 'axios';
const route = useRoute();
const router = useRouter();

//反填
let model = reactive({
    Id:route.query.Id,
    "Name": '',
    "Number": '',

})




//反填
onMounted(()=>{
    GetAll();
})

const GetAll=()=>{
axios({

url:'https://localhost:7259/api/HouseType/PeiFangAll',
method:'get',
params: {Id:route.query.Id},
})

.then((res)=>{
    console.log(res);
    model.Name=res.data.Name;
    model.Number=res.data.Number;
    
})


.catch((ree)=>{
    console.log(ree);
})

}





</script>

<style scoped></style>